Advertisement
Guest User

Dykam

a guest
Aug 4th, 2009
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.65 KB | None | 0 0
  1. Every page starts with:
  2. <?php
  3. require $_SERVER['DOCUMENT_ROOT'] . '/min/page.php';
  4. ?>
  5. Then you can add paths to scripts and stylesheets to be included. It can be one of following, all having their css counterparts.
  6.     Minify::IncludeJs(string script);
  7.     Minify::IncludeJs(array scripts);
  8.     Minify::IncludeJs(string tag, string script); // Tag is to choose later on
  9.     Minify::IncludeJs(string tag, array stylesheets); // which files to include where
  10.    
  11. Examples:
  12. <?
  13. Minify::IncludeJs(array(
  14.     "/my/jquery/script.js",
  15.     "/my/own/script.js"
  16. ));
  17. Minify::IncludeCss(array(
  18.     "/my/base/stylesheet.css",
  19.     "/my/page/stylesheetcss"
  20. ));
  21.  
  22. Inline you use the following codes to give the reference tags a place, all having their css counterparts:
  23.     Minify::Js(); // Places the included, nontagged files, with script tags, html version to be set in config.
  24.     Minify::Js(bool all); // Same as first, but tagged too when true.
  25.     Minify::Js(string tag); // Same as first, but with the tagged files.
  26.     Minify::Js(array tags); // Same as above, but with multiple tags.
  27.    
  28.     Minify::JsNow(string script); // Compresses and places the script.
  29.     Minify::JsNow(array scripts); // Compresses and places the scripts.
  30.     // All have optional int spreading = 2
  31.     // The spreading param makes the scripts to be spread over `spreading` files, to use the HTTP asynchronous loading capability which defaults to 2 at a time.
  32.    
  33. Examples:
  34. <?php
  35. Minify::JsNow(array(
  36.     "/my/jquery/script.js",
  37.     "/my/own/script.js"
  38. ), 1);
  39. Minify::CssNos(array(
  40.     "/my/base/stylesheet.css",
  41.     "/my/page/stylesheetcss"
  42. ), 1);
  43.  
  44. Minify::Js("globalfiles"); // Include some globaly defined files.
  45. Minify::Css("globalfiles");
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement